/*
 * Copyright 2018 JDCLOUD.COM
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http:#www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * 负载均衡
 * 负载均衡相关API
 *
 * OpenAPI spec version: v1
 * Contact: 
 *
 * NOTE: This class is auto generated by the jdcloud code generator program.
 */


using JDCloudSDK.Core.Auth;
using JDCloudSDK.Core.Client;
using JDCloudSDK.Core.Http;
using JDCloudSDK.Lb.Apis;
using JDCloudSDK.Lb.Model;
using System;
using System.Collections.Generic;
using System.Text;
#if NET40||NET35
#else
using System.Threading.Tasks;
#endif

namespace JDCloudSDK.Lb.Client
{
    /// <summary>
    ///  负载均衡
    ///  负载均衡相关API
    ///  Lb Api 客户端
    ///</summary>
    public class LbClient : JdcloudClient
    {

        /// <summary>
        ///  默认私有构造函数
        /// </summary>
        private LbClient()
        {

        }

        /// <summary>
        /// 默认构造函数
        /// </summary>
        /// <param name="credentialsProvider">认证信息</param>
        /// <param name="httpRequestConfig">http 客户端配置信息</param>
        /// <param name="environment">sdk 环境配置信息</param>
        public LbClient(CredentialsProvider credentialsProvider, HttpRequestConfig httpRequestConfig,SDKEnvironment environment)
        {
            this.httpRequestConfig = httpRequestConfig;
            this.credentialsProvider = credentialsProvider;
            this.environment = environment;
        }

        /// <summary>
        /// 默认构造函数
        /// </summary>
        /// <param name="httpRequestConfig">http 客户端配置信息</param>
        /// <param name="credentialsProvider">认证信息</param>
        public LbClient(CredentialsProvider credentialsProvider,HttpRequestConfig httpRequestConfig)
        {
            this.httpRequestConfig = httpRequestConfig;
            this.credentialsProvider = credentialsProvider;
        }

        /// <summary>
        /// 默认构造函数，
        /// 注意如果使用此方法 httpRequestConfig 使用的http 请求 schema 为Https
        /// </summary>
        /// <param name="credentialsProvider">认证信息</param>
        public LbClient(CredentialsProvider credentialsProvider)
        {
            this.credentialsProvider = credentialsProvider;
        }

        /// <summary>
        ///  版本号 1.2.8
        ///</summary>
        public const string ClientVersion = "1.2.8";

        private const string apiVersion = "v1";
        private const string userAgentPrefix = "JdcloudSdkDotNet";
        private const string defaultEndpoint = "lb.jdcloud-api.com";
        private const string serviceName = "lb";
        private const string userAgent = userAgentPrefix + "/" + ClientVersion + " " + serviceName + "/" + apiVersion;


        private SDKEnvironment environment = new SDKEnvironment(defaultEndpoint);
        private CredentialsProvider credentialsProvider;
        private HttpRequestConfig httpRequestConfig;

        /// <summary>
        ///  获取证书信息
        ///</summary>
        public override CredentialsProvider CredentialsProvider   { get { return credentialsProvider; } }

        /// <summary>
        ///  获取http 客户端配置信息
        ///</summary>
        public override HttpRequestConfig HttpRequestConfig { get { return httpRequestConfig; } }

        /// <summary>
        ///  获取sdk环境配置信息
        ///</summary>
        public override SDKEnvironment SDKEnvironment { get { return environment; } }

        /// <summary>
        ///  获取用户自定义浏览器识别字符串
        ///</summary>
        public override string UserAgent { get { return userAgent; } }

        /// <summary>
        ///  获取服务名称
        ///</summary>
        public override string ServiceName { get { return serviceName; } }

        /// <summary>
        ///  获取版本号
        ///</summary>
        public override string Version { get { return apiVersion; } }



#if NET40||NET35
        /// <summary>
        ///  查询监听器列表
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeListenersResponse DescribeListeners(DescribeListenersRequest request) {
            return  new DescribeListenersExecutor().Client(this).Execute<DescribeListenersResponse, DescribeListenersResult, DescribeListenersRequest>(request);
        }
#else
        /// <summary>
        ///  查询监听器列表
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeListenersResponse> DescribeListeners(DescribeListenersRequest request) {
            return await new DescribeListenersExecutor().Client(this).Execute<DescribeListenersResponse, DescribeListenersResult, DescribeListenersRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询后端服务详情
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeBackendResponse DescribeBackend(DescribeBackendRequest request) {
            return  new DescribeBackendExecutor().Client(this).Execute<DescribeBackendResponse, DescribeBackendResult, DescribeBackendRequest>(request);
        }
#else
        /// <summary>
        ///  查询后端服务详情
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeBackendResponse> DescribeBackend(DescribeBackendRequest request) {
            return await new DescribeBackendExecutor().Client(this).Execute<DescribeBackendResponse, DescribeBackendResult, DescribeBackendRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  往TargetGroup中加入Target
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public RegisterTargetsResponse RegisterTargets(RegisterTargetsRequest request) {
            return  new RegisterTargetsExecutor().Client(this).Execute<RegisterTargetsResponse, RegisterTargetsResult, RegisterTargetsRequest>(request);
        }
#else
        /// <summary>
        ///  往TargetGroup中加入Target
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<RegisterTargetsResponse> RegisterTargets(RegisterTargetsRequest request) {
            return await new RegisterTargetsExecutor().Client(this).Execute<RegisterTargetsResponse, RegisterTargetsResult, RegisterTargetsRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询转发规则组详情
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeUrlMapResponse DescribeUrlMap(DescribeUrlMapRequest request) {
            return  new DescribeUrlMapExecutor().Client(this).Execute<DescribeUrlMapResponse, DescribeUrlMapResult, DescribeUrlMapRequest>(request);
        }
#else
        /// <summary>
        ///  查询转发规则组详情
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeUrlMapResponse> DescribeUrlMap(DescribeUrlMapRequest request) {
            return await new DescribeUrlMapExecutor().Client(this).Execute<DescribeUrlMapResponse, DescribeUrlMapResult, DescribeUrlMapRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  删除转发规则
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DeleteRulesResponse DeleteRules(DeleteRulesRequest request) {
            return  new DeleteRulesExecutor().Client(this).Execute<DeleteRulesResponse, DeleteRulesResult, DeleteRulesRequest>(request);
        }
#else
        /// <summary>
        ///  删除转发规则
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DeleteRulesResponse> DeleteRules(DeleteRulesRequest request) {
            return await new DeleteRulesExecutor().Client(this).Execute<DeleteRulesResponse, DeleteRulesResult, DeleteRulesRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询负载均衡列表详情
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeLoadBalancersResponse DescribeLoadBalancers(DescribeLoadBalancersRequest request) {
            return  new DescribeLoadBalancersExecutor().Client(this).Execute<DescribeLoadBalancersResponse, DescribeLoadBalancersResult, DescribeLoadBalancersRequest>(request);
        }
#else
        /// <summary>
        ///  查询负载均衡列表详情
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeLoadBalancersResponse> DescribeLoadBalancers(DescribeLoadBalancersRequest request) {
            return await new DescribeLoadBalancersExecutor().Client(this).Execute<DescribeLoadBalancersResponse, DescribeLoadBalancersResult, DescribeLoadBalancersRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  更新负载均衡信息
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public UpdateLoadBalancerResponse UpdateLoadBalancer(UpdateLoadBalancerRequest request) {
            return  new UpdateLoadBalancerExecutor().Client(this).Execute<UpdateLoadBalancerResponse, UpdateLoadBalancerResult, UpdateLoadBalancerRequest>(request);
        }
#else
        /// <summary>
        ///  更新负载均衡信息
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<UpdateLoadBalancerResponse> UpdateLoadBalancer(UpdateLoadBalancerRequest request) {
            return await new UpdateLoadBalancerExecutor().Client(this).Execute<UpdateLoadBalancerResponse, UpdateLoadBalancerResult, UpdateLoadBalancerRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  修改target信息
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public UpdateTargetsResponse UpdateTargets(UpdateTargetsRequest request) {
            return  new UpdateTargetsExecutor().Client(this).Execute<UpdateTargetsResponse, UpdateTargetsResult, UpdateTargetsRequest>(request);
        }
#else
        /// <summary>
        ///  修改target信息
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<UpdateTargetsResponse> UpdateTargets(UpdateTargetsRequest request) {
            return await new UpdateTargetsExecutor().Client(this).Execute<UpdateTargetsResponse, UpdateTargetsResult, UpdateTargetsRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询TargetGroup详情，返回target详情功能3个月后将会下线，建议用户直接使用describeTargets接口查询target详情
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeTargetGroupResponse DescribeTargetGroup(DescribeTargetGroupRequest request) {
            return  new DescribeTargetGroupExecutor().Client(this).Execute<DescribeTargetGroupResponse, DescribeTargetGroupResult, DescribeTargetGroupRequest>(request);
        }
#else
        /// <summary>
        ///  查询TargetGroup详情，返回target详情功能3个月后将会下线，建议用户直接使用describeTargets接口查询target详情
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeTargetGroupResponse> DescribeTargetGroup(DescribeTargetGroupRequest request) {
            return await new DescribeTargetGroupExecutor().Client(this).Execute<DescribeTargetGroupResponse, DescribeTargetGroupResult, DescribeTargetGroupRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  删除一个后端服务
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DeleteBackendResponse DeleteBackend(DeleteBackendRequest request) {
            return  new DeleteBackendExecutor().Client(this).Execute<DeleteBackendResponse, DeleteBackendResult, DeleteBackendRequest>(request);
        }
#else
        /// <summary>
        ///  删除一个后端服务
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DeleteBackendResponse> DeleteBackend(DeleteBackendRequest request) {
            return await new DeleteBackendExecutor().Client(this).Execute<DeleteBackendResponse, DeleteBackendResult, DeleteBackendRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  listener批量删除扩展证书
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DeleteListenerCertificatesResponse DeleteListenerCertificates(DeleteListenerCertificatesRequest request) {
            return  new DeleteListenerCertificatesExecutor().Client(this).Execute<DeleteListenerCertificatesResponse, DeleteListenerCertificatesResult, DeleteListenerCertificatesRequest>(request);
        }
#else
        /// <summary>
        ///  listener批量删除扩展证书
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DeleteListenerCertificatesResponse> DeleteListenerCertificates(DeleteListenerCertificatesRequest request) {
            return await new DeleteListenerCertificatesExecutor().Client(this).Execute<DeleteListenerCertificatesResponse, DeleteListenerCertificatesResult, DeleteListenerCertificatesRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  往转发规则组加入转发规则
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public AddRulesResponse AddRules(AddRulesRequest request) {
            return  new AddRulesExecutor().Client(this).Execute<AddRulesResponse, AddRulesResult, AddRulesRequest>(request);
        }
#else
        /// <summary>
        ///  往转发规则组加入转发规则
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<AddRulesResponse> AddRules(AddRulesRequest request) {
            return await new AddRulesExecutor().Client(this).Execute<AddRulesResponse, AddRulesResult, AddRulesRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  修改转发规则组
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public UpdateUrlMapResponse UpdateUrlMap(UpdateUrlMapRequest request) {
            return  new UpdateUrlMapExecutor().Client(this).Execute<UpdateUrlMapResponse, UpdateUrlMapResult, UpdateUrlMapRequest>(request);
        }
#else
        /// <summary>
        ///  修改转发规则组
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<UpdateUrlMapResponse> UpdateUrlMap(UpdateUrlMapRequest request) {
            return await new UpdateUrlMapExecutor().Client(this).Execute<UpdateUrlMapResponse, UpdateUrlMapResult, UpdateUrlMapRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  修改一个后端服务的信息
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public UpdateBackendResponse UpdateBackend(UpdateBackendRequest request) {
            return  new UpdateBackendExecutor().Client(this).Execute<UpdateBackendResponse, UpdateBackendResult, UpdateBackendRequest>(request);
        }
#else
        /// <summary>
        ///  修改一个后端服务的信息
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<UpdateBackendResponse> UpdateBackend(UpdateBackendRequest request) {
            return await new UpdateBackendExecutor().Client(this).Execute<UpdateBackendResponse, UpdateBackendResult, UpdateBackendRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  负载均衡绑定弹性公网IP
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public AssociateElasticIpResponse AssociateElasticIp(AssociateElasticIpRequest request) {
            return  new AssociateElasticIpExecutor().Client(this).Execute<AssociateElasticIpResponse, AssociateElasticIpResult, AssociateElasticIpRequest>(request);
        }
#else
        /// <summary>
        ///  负载均衡绑定弹性公网IP
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<AssociateElasticIpResponse> AssociateElasticIp(AssociateElasticIpRequest request) {
            return await new AssociateElasticIpExecutor().Client(this).Execute<AssociateElasticIpResponse, AssociateElasticIpResult, AssociateElasticIpRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  创建转发规则组,仅alb支持
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public CreateUrlMapResponse CreateUrlMap(CreateUrlMapRequest request) {
            return  new CreateUrlMapExecutor().Client(this).Execute<CreateUrlMapResponse, CreateUrlMapResult, CreateUrlMapRequest>(request);
        }
#else
        /// <summary>
        ///  创建转发规则组,仅alb支持
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<CreateUrlMapResponse> CreateUrlMap(CreateUrlMapRequest request) {
            return await new CreateUrlMapExecutor().Client(this).Execute<CreateUrlMapResponse, CreateUrlMapResult, CreateUrlMapRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  创建一个后端服务
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public CreateBackendResponse CreateBackend(CreateBackendRequest request) {
            return  new CreateBackendExecutor().Client(this).Execute<CreateBackendResponse, CreateBackendResult, CreateBackendRequest>(request);
        }
#else
        /// <summary>
        ///  创建一个后端服务
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<CreateBackendResponse> CreateBackend(CreateBackendRequest request) {
            return await new CreateBackendExecutor().Client(this).Execute<CreateBackendResponse, CreateBackendResult, CreateBackendRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  创建一个虚拟服务器组
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public CreateTargetGroupResponse CreateTargetGroup(CreateTargetGroupRequest request) {
            return  new CreateTargetGroupExecutor().Client(this).Execute<CreateTargetGroupResponse, CreateTargetGroupResult, CreateTargetGroupRequest>(request);
        }
#else
        /// <summary>
        ///  创建一个虚拟服务器组
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<CreateTargetGroupResponse> CreateTargetGroup(CreateTargetGroupRequest request) {
            return await new CreateTargetGroupExecutor().Client(this).Execute<CreateTargetGroupResponse, CreateTargetGroupResult, CreateTargetGroupRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  修改一个虚拟服务器组的信息
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public UpdateTargetGroupResponse UpdateTargetGroup(UpdateTargetGroupRequest request) {
            return  new UpdateTargetGroupExecutor().Client(this).Execute<UpdateTargetGroupResponse, UpdateTargetGroupResult, UpdateTargetGroupRequest>(request);
        }
#else
        /// <summary>
        ///  修改一个虚拟服务器组的信息
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<UpdateTargetGroupResponse> UpdateTargetGroup(UpdateTargetGroupRequest request) {
            return await new UpdateTargetGroupExecutor().Client(this).Execute<UpdateTargetGroupResponse, UpdateTargetGroupResult, UpdateTargetGroupRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询负载均衡详情
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeLoadBalancerResponse DescribeLoadBalancer(DescribeLoadBalancerRequest request) {
            return  new DescribeLoadBalancerExecutor().Client(this).Execute<DescribeLoadBalancerResponse, DescribeLoadBalancerResult, DescribeLoadBalancerRequest>(request);
        }
#else
        /// <summary>
        ///  查询负载均衡详情
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeLoadBalancerResponse> DescribeLoadBalancer(DescribeLoadBalancerRequest request) {
            return await new DescribeLoadBalancerExecutor().Client(this).Execute<DescribeLoadBalancerResponse, DescribeLoadBalancerResult, DescribeLoadBalancerRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  修改一个监听器的信息
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public UpdateListenerResponse UpdateListener(UpdateListenerRequest request) {
            return  new UpdateListenerExecutor().Client(this).Execute<UpdateListenerResponse, UpdateListenerResult, UpdateListenerRequest>(request);
        }
#else
        /// <summary>
        ///  修改一个监听器的信息
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<UpdateListenerResponse> UpdateListener(UpdateListenerRequest request) {
            return await new UpdateListenerExecutor().Client(this).Execute<UpdateListenerResponse, UpdateListenerResult, UpdateListenerRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询监听器详情
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeListenerResponse DescribeListener(DescribeListenerRequest request) {
            return  new DescribeListenerExecutor().Client(this).Execute<DescribeListenerResponse, DescribeListenerResult, DescribeListenerRequest>(request);
        }
#else
        /// <summary>
        ///  查询监听器详情
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeListenerResponse> DescribeListener(DescribeListenerRequest request) {
            return await new DescribeListenerExecutor().Client(this).Execute<DescribeListenerResponse, DescribeListenerResult, DescribeListenerRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询虚拟服务器组列表详情，返回target详情功能3个月后将会下线，建议用户直接使用describeTargets接口查询target详情
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeTargetGroupsResponse DescribeTargetGroups(DescribeTargetGroupsRequest request) {
            return  new DescribeTargetGroupsExecutor().Client(this).Execute<DescribeTargetGroupsResponse, DescribeTargetGroupsResult, DescribeTargetGroupsRequest>(request);
        }
#else
        /// <summary>
        ///  查询虚拟服务器组列表详情，返回target详情功能3个月后将会下线，建议用户直接使用describeTargets接口查询target详情
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeTargetGroupsResponse> DescribeTargetGroups(DescribeTargetGroupsRequest request) {
            return await new DescribeTargetGroupsExecutor().Client(this).Execute<DescribeTargetGroupsResponse, DescribeTargetGroupsResult, DescribeTargetGroupsRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  删除负载均衡，负载均衡下的监听器，转发规则组(仅alb支持)，后端服务，服务器组会一起删除
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DeleteLoadBalancerResponse DeleteLoadBalancer(DeleteLoadBalancerRequest request) {
            return  new DeleteLoadBalancerExecutor().Client(this).Execute<DeleteLoadBalancerResponse, DeleteLoadBalancerResult, DeleteLoadBalancerRequest>(request);
        }
#else
        /// <summary>
        ///  删除负载均衡，负载均衡下的监听器，转发规则组(仅alb支持)，后端服务，服务器组会一起删除
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DeleteLoadBalancerResponse> DeleteLoadBalancer(DeleteLoadBalancerRequest request) {
            return await new DeleteLoadBalancerExecutor().Client(this).Execute<DeleteLoadBalancerResponse, DeleteLoadBalancerResult, DeleteLoadBalancerRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  负载均衡解绑安全组
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DisassociateSecurityGroupResponse DisassociateSecurityGroup(DisassociateSecurityGroupRequest request) {
            return  new DisassociateSecurityGroupExecutor().Client(this).Execute<DisassociateSecurityGroupResponse, DisassociateSecurityGroupResult, DisassociateSecurityGroupRequest>(request);
        }
#else
        /// <summary>
        ///  负载均衡解绑安全组
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DisassociateSecurityGroupResponse> DisassociateSecurityGroup(DisassociateSecurityGroupRequest request) {
            return await new DisassociateSecurityGroupExecutor().Client(this).Execute<DisassociateSecurityGroupResponse, DisassociateSecurityGroupResult, DisassociateSecurityGroupRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询后端服务列表
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeBackendsResponse DescribeBackends(DescribeBackendsRequest request) {
            return  new DescribeBackendsExecutor().Client(this).Execute<DescribeBackendsResponse, DescribeBackendsResult, DescribeBackendsRequest>(request);
        }
#else
        /// <summary>
        ///  查询后端服务列表
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeBackendsResponse> DescribeBackends(DescribeBackendsRequest request) {
            return await new DescribeBackendsExecutor().Client(this).Execute<DescribeBackendsResponse, DescribeBackendsResult, DescribeBackendsRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  负载均衡绑定安全组
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public AssociateSecurityGroupResponse AssociateSecurityGroup(AssociateSecurityGroupRequest request) {
            return  new AssociateSecurityGroupExecutor().Client(this).Execute<AssociateSecurityGroupResponse, AssociateSecurityGroupResult, AssociateSecurityGroupRequest>(request);
        }
#else
        /// <summary>
        ///  负载均衡绑定安全组
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<AssociateSecurityGroupResponse> AssociateSecurityGroup(AssociateSecurityGroupRequest request) {
            return await new AssociateSecurityGroupExecutor().Client(this).Execute<AssociateSecurityGroupResponse, AssociateSecurityGroupResult, AssociateSecurityGroupRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  从TargetGroup中移除一个或多个Target，失败则全部回滚。 成功移除的target将不会再接收来自loadbalancer新建连接的流量
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DeRegisterTargetsResponse DeRegisterTargets(DeRegisterTargetsRequest request) {
            return  new DeRegisterTargetsExecutor().Client(this).Execute<DeRegisterTargetsResponse, DeRegisterTargetsResult, DeRegisterTargetsRequest>(request);
        }
#else
        /// <summary>
        ///  从TargetGroup中移除一个或多个Target，失败则全部回滚。 成功移除的target将不会再接收来自loadbalancer新建连接的流量
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DeRegisterTargetsResponse> DeRegisterTargets(DeRegisterTargetsRequest request) {
            return await new DeRegisterTargetsExecutor().Client(this).Execute<DeRegisterTargetsResponse, DeRegisterTargetsResult, DeRegisterTargetsRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询Target列表详情
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeTargetsResponse DescribeTargets(DescribeTargetsRequest request) {
            return  new DescribeTargetsExecutor().Client(this).Execute<DescribeTargetsResponse, DescribeTargetsResult, DescribeTargetsRequest>(request);
        }
#else
        /// <summary>
        ///  查询Target列表详情
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeTargetsResponse> DescribeTargets(DescribeTargetsRequest request) {
            return await new DescribeTargetsExecutor().Client(this).Execute<DescribeTargetsResponse, DescribeTargetsResult, DescribeTargetsRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  创建负载均衡
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public CreateLoadBalancerResponse CreateLoadBalancer(CreateLoadBalancerRequest request) {
            return  new CreateLoadBalancerExecutor().Client(this).Execute<CreateLoadBalancerResponse, CreateLoadBalancerResult, CreateLoadBalancerRequest>(request);
        }
#else
        /// <summary>
        ///  创建负载均衡
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<CreateLoadBalancerResponse> CreateLoadBalancer(CreateLoadBalancerRequest request) {
            return await new CreateLoadBalancerExecutor().Client(this).Execute<CreateLoadBalancerResponse, CreateLoadBalancerResult, CreateLoadBalancerRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  创建一个监听器
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public CreateListenerResponse CreateListener(CreateListenerRequest request) {
            return  new CreateListenerExecutor().Client(this).Execute<CreateListenerResponse, CreateListenerResult, CreateListenerRequest>(request);
        }
#else
        /// <summary>
        ///  创建一个监听器
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<CreateListenerResponse> CreateListener(CreateListenerRequest request) {
            return await new CreateListenerExecutor().Client(this).Execute<CreateListenerResponse, CreateListenerResult, CreateListenerRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  删除转发规则组
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DeleteUrlMapResponse DeleteUrlMap(DeleteUrlMapRequest request) {
            return  new DeleteUrlMapExecutor().Client(this).Execute<DeleteUrlMapResponse, DeleteUrlMapResult, DeleteUrlMapRequest>(request);
        }
#else
        /// <summary>
        ///  删除转发规则组
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DeleteUrlMapResponse> DeleteUrlMap(DeleteUrlMapRequest request) {
            return await new DeleteUrlMapExecutor().Client(this).Execute<DeleteUrlMapResponse, DeleteUrlMapResult, DeleteUrlMapRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  删除一个虚拟服务器组
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DeleteTargetGroupResponse DeleteTargetGroup(DeleteTargetGroupRequest request) {
            return  new DeleteTargetGroupExecutor().Client(this).Execute<DeleteTargetGroupResponse, DeleteTargetGroupResult, DeleteTargetGroupRequest>(request);
        }
#else
        /// <summary>
        ///  删除一个虚拟服务器组
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DeleteTargetGroupResponse> DeleteTargetGroup(DeleteTargetGroupRequest request) {
            return await new DeleteTargetGroupExecutor().Client(this).Execute<DeleteTargetGroupResponse, DeleteTargetGroupResult, DeleteTargetGroupRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询后端服务下的target的健康状态
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeTargetHealthResponse DescribeTargetHealth(DescribeTargetHealthRequest request) {
            return  new DescribeTargetHealthExecutor().Client(this).Execute<DescribeTargetHealthResponse, DescribeTargetHealthResult, DescribeTargetHealthRequest>(request);
        }
#else
        /// <summary>
        ///  查询后端服务下的target的健康状态
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeTargetHealthResponse> DescribeTargetHealth(DescribeTargetHealthRequest request) {
            return await new DescribeTargetHealthExecutor().Client(this).Execute<DescribeTargetHealthResponse, DescribeTargetHealthResult, DescribeTargetHealthRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  listener批量添加扩展证书
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public AddListenerCertificatesResponse AddListenerCertificates(AddListenerCertificatesRequest request) {
            return  new AddListenerCertificatesExecutor().Client(this).Execute<AddListenerCertificatesResponse, AddListenerCertificatesResult, AddListenerCertificatesRequest>(request);
        }
#else
        /// <summary>
        ///  listener批量添加扩展证书
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<AddListenerCertificatesResponse> AddListenerCertificates(AddListenerCertificatesRequest request) {
            return await new AddListenerCertificatesExecutor().Client(this).Execute<AddListenerCertificatesResponse, AddListenerCertificatesResult, AddListenerCertificatesRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  负载均衡解绑弹性公网IP
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DisassociateElasticIpResponse DisassociateElasticIp(DisassociateElasticIpRequest request) {
            return  new DisassociateElasticIpExecutor().Client(this).Execute<DisassociateElasticIpResponse, DisassociateElasticIpResult, DisassociateElasticIpRequest>(request);
        }
#else
        /// <summary>
        ///  负载均衡解绑弹性公网IP
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DisassociateElasticIpResponse> DisassociateElasticIp(DisassociateElasticIpRequest request) {
            return await new DisassociateElasticIpExecutor().Client(this).Execute<DisassociateElasticIpResponse, DisassociateElasticIpResult, DisassociateElasticIpRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  修改转发规则
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public UpdateRulesResponse UpdateRules(UpdateRulesRequest request) {
            return  new UpdateRulesExecutor().Client(this).Execute<UpdateRulesResponse, UpdateRulesResult, UpdateRulesRequest>(request);
        }
#else
        /// <summary>
        ///  修改转发规则
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<UpdateRulesResponse> UpdateRules(UpdateRulesRequest request) {
            return await new UpdateRulesExecutor().Client(this).Execute<UpdateRulesResponse, UpdateRulesResult, UpdateRulesRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  listener批量修改扩展证书
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public UpdateListenerCertificatesResponse UpdateListenerCertificates(UpdateListenerCertificatesRequest request) {
            return  new UpdateListenerCertificatesExecutor().Client(this).Execute<UpdateListenerCertificatesResponse, UpdateListenerCertificatesResult, UpdateListenerCertificatesRequest>(request);
        }
#else
        /// <summary>
        ///  listener批量修改扩展证书
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<UpdateListenerCertificatesResponse> UpdateListenerCertificates(UpdateListenerCertificatesRequest request) {
            return await new UpdateListenerCertificatesExecutor().Client(this).Execute<UpdateListenerCertificatesResponse, UpdateListenerCertificatesResult, UpdateListenerCertificatesRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  删除一个监听器
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DeleteListenerResponse DeleteListener(DeleteListenerRequest request) {
            return  new DeleteListenerExecutor().Client(this).Execute<DeleteListenerResponse, DeleteListenerResult, DeleteListenerRequest>(request);
        }
#else
        /// <summary>
        ///  删除一个监听器
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DeleteListenerResponse> DeleteListener(DeleteListenerRequest request) {
            return await new DeleteListenerExecutor().Client(this).Execute<DeleteListenerResponse, DeleteListenerResult, DeleteListenerRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询转发规则组列表详情
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeUrlMapsResponse DescribeUrlMaps(DescribeUrlMapsRequest request) {
            return  new DescribeUrlMapsExecutor().Client(this).Execute<DescribeUrlMapsResponse, DescribeUrlMapsResult, DescribeUrlMapsRequest>(request);
        }
#else
        /// <summary>
        ///  查询转发规则组列表详情
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeUrlMapsResponse> DescribeUrlMaps(DescribeUrlMapsRequest request) {
            return await new DescribeUrlMapsExecutor().Client(this).Execute<DescribeUrlMapsResponse, DescribeUrlMapsResult, DescribeUrlMapsRequest>(request).ConfigureAwait(false);
        }
#endif

            /// <summary>
            ///  默认LbClient 构造器 接口
            ///</summary>
            public interface Builder
            {

                /// <summary>
                /// 设置认证信息参数
                /// </summary>
                /// <param name="provider">认证信息提供对象</param>
                /// <returns>lbClient 构造器</returns>
                Builder CredentialsProvider(CredentialsProvider provider);

                /// <summary>
                /// 设置请求环境参数
                /// </summary>
                /// <param name="environment">环境参数信息</param>
                /// <returns>lbClient 构造器</returns>
                Builder Environment(Core.Client.SDKEnvironment environment);

                /// <summary>
                /// http 请求配置信息
                /// </summary>
                /// <param name="config">http 请求配置信息</param>
                /// <returns>lbClient 构造器</returns>
                Builder HttpRequestConfig(HttpRequestConfig config);

                /// <summary>
                ///  构造LbClient 对象
                ///</summary>
                LbClient Build();
            }

            /// <summary>
            ///  默认LbClient 构造器
            ///</summary>
            public class DefaultBuilder : Builder
            {
                /// <summary>
                ///  LbClient service client
                /// </summary>
                private  LbClient lbClient;

                /// <summary>
                ///  默认LbClient 构造器构造对象
                ///</summary>
                public DefaultBuilder()
                {
                    lbClient = new LbClient();
                }

                /// <summary>
                ///  构造LbClient 对象
                ///</summary>
                public LbClient Build()
                {
                    if (lbClient.CredentialsProvider == null)
                    {
                        //if credentialsProvider not set, try load jdcloud global default  credentials provider
                        lbClient.credentialsProvider = JdCloud.DefaultInstance.GetCredentialsProvider();
                        if (lbClient.credentialsProvider == null)
                        {
                            throw new ArgumentNullException("LbClient build error: jdcloud credentials provider not set");
                        }
                    }
                    if (lbClient.HttpRequestConfig == null)
                    {
                        lbClient.httpRequestConfig = JdCloud.DefaultInstance.GetHttpRequestConfig();
                        if (lbClient.httpRequestConfig == null)
                        {
                        throw new ArgumentNullException("LbClient build error: http request config not set");
                        }
                    }
                    return lbClient;
                }

                /// <summary>
                /// 设置认证信息参数
                /// </summary>
                /// <param name="provider">认证信息提供对象</param>
                /// <returns>lbClient 构造器</returns>
                public Builder CredentialsProvider(CredentialsProvider provider)
                {
                    lbClient.credentialsProvider = provider;
                    return this;
                }

                /// <summary>
                /// 设置请求环境参数
                /// </summary>
                /// <param name="environment">环境参数信息</param>
                /// <returns>lbClient 构造器</returns>
                public Builder Environment(SDKEnvironment environment)
                {
                    lbClient.environment = environment;
                    return this;
                }

                /// <summary>
                /// http 请求配置信息
                /// </summary>
                /// <param name="config">http 请求配置信息</param>
                /// <returns>lbClient 构造器</returns>
                public Builder HttpRequestConfig(HttpRequestConfig config)
                {
                    lbClient.httpRequestConfig = config;
                    return this;
                }
            }
    }
}
